package nl.sanity.events
{
	import flash.events.Event;

	/**
	 * UIEvent
	 * For usage in combination with the BaseComponent class (or extends)
	 * 
	 * @langversion ActionScript 3
	 *
	 * @author M.P. Bartnig
	 * @since  28/03/2009
	 */
	public class UIEvent extends Event
	{
		public static const	DRAW	: String = "draw";
		
		protected var _data			: Object;
		
		// --- CONSTRUCTOR ----------------------------------------

		public function UIEvent( type:String, data:Object = null, bubbles:Boolean = false, cancelable:Boolean = false )
		{
			_data 		= data;
			
			super( type, bubbles, cancelable );
		}
		
		// --- OVERRIDE FUNCTIONS ----------------------------------------

		/**
		 * Creates and returns a copy of the current instance.
		 * @return a copy of the current instance.
		 */
		public override function clone():Event
		{
			return new UIEvent( type, _data, bubbles, cancelable );
		}
		
		// --- GETTERS/SETTERS ----------------------------------------

		public function get data():Object
		{
			return _data;
		}
	}
}